package com.czm.art_light.service.impl;

import com.czm.art_light.config.MinioProp;
import com.czm.art_light.param.response.RestResp;
import com.czm.art_light.service.ArtResourceService;
import com.czm.art_light.util.MinIoUtil;
import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

/**
 * 资源（图片/视频/文档）相关服务实现类
 */
@Service
public class ArtResourceServiceImpl implements ArtResourceService {

    @Autowired
    private  MinioProp minioProp;

    @Autowired
    private  MinioClient minioClient;

    @Override
    public RestResp<String> uploadImage(String imagePathPrefix,MultipartFile file) {
        return MinIoUtil.uploadImage(imagePathPrefix,file, minioProp.getBucketName(), minioClient);
    }
}
